/*
 * An XML document type.
 * Localname: process-definition
 * Namespace: urn:jbpm.org:jpdl-3.2
 * Java type: x2.orgJpdl3.jbpm.ProcessDefinitionDocument
 *
 * Automatically generated - do not modify.
 */
package x2.orgJpdl3.jbpm.impl;
/**
 * A document containing one process-definition(@urn:jbpm.org:jpdl-3.2) element.
 *
 * This is a complex type.
 */
public class ProcessDefinitionDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements x2.orgJpdl3.jbpm.ProcessDefinitionDocument
{
    private static final long serialVersionUID = 1L;
    
    public ProcessDefinitionDocumentImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName PROCESSDEFINITION$0 = 
        new javax.xml.namespace.QName("urn:jbpm.org:jpdl-3.2", "process-definition");
    
    
    /**
     * Gets the "process-definition" element
     */
    public x2.orgJpdl3.jbpm.ProcessDefinitionDocument.ProcessDefinition getProcessDefinition()
    {
        synchronized (monitor())
        {
            check_orphaned();
            x2.orgJpdl3.jbpm.ProcessDefinitionDocument.ProcessDefinition target = null;
            target = (x2.orgJpdl3.jbpm.ProcessDefinitionDocument.ProcessDefinition)get_store().find_element_user(PROCESSDEFINITION$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "process-definition" element
     */
    public void setProcessDefinition(x2.orgJpdl3.jbpm.ProcessDefinitionDocument.ProcessDefinition processDefinition)
    {
        synchronized (monitor())
        {
            check_orphaned();
            x2.orgJpdl3.jbpm.ProcessDefinitionDocument.ProcessDefinition target = null;
            target = (x2.orgJpdl3.jbpm.ProcessDefinitionDocument.ProcessDefinition)get_store().find_element_user(PROCESSDEFINITION$0, 0);
            if (target == null)
            {
                target = (x2.orgJpdl3.jbpm.ProcessDefinitionDocument.ProcessDefinition)get_store().add_element_user(PROCESSDEFINITION$0);
            }
            target.set(processDefinition);
        }
    }
    
    /**
     * Appends and returns a new empty "process-definition" element
     */
    public x2.orgJpdl3.jbpm.ProcessDefinitionDocument.ProcessDefinition addNewProcessDefinition()
    {
        synchronized (monitor())
        {
            check_orphaned();
            x2.orgJpdl3.jbpm.ProcessDefinitionDocument.ProcessDefinition target = null;
            target = (x2.orgJpdl3.jbpm.ProcessDefinitionDocument.ProcessDefinition)get_store().add_element_user(PROCESSDEFINITION$0);
            return target;
        }
    }
    /**
     * An XML process-definition(@urn:jbpm.org:jpdl-3.2).
     *
     * This is a complex type.
     */
    public static class ProcessDefinitionImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements x2.orgJpdl3.jbpm.ProcessDefinitionDocument.ProcessDefinition
    {
        private static final long serialVersionUID = 1L;
        
        public ProcessDefinitionImpl(org.apache.xmlbeans.SchemaType sType)
        {
            super(sType);
        }
        
        private static final javax.xml.namespace.QName DESCRIPTION$0 = 
            new javax.xml.namespace.QName("urn:jbpm.org:jpdl-3.2", "description");
        private static final javax.xml.namespace.QName SWIMLANE$2 = 
            new javax.xml.namespace.QName("urn:jbpm.org:jpdl-3.2", "swimlane");
        private static final javax.xml.namespace.QName STARTSTATE$4 = 
            new javax.xml.namespace.QName("urn:jbpm.org:jpdl-3.2", "start-state");
        private static final javax.xml.namespace.QName NODE$6 = 
            new javax.xml.namespace.QName("urn:jbpm.org:jpdl-3.2", "node");
        private static final javax.xml.namespace.QName STATE$8 = 
            new javax.xml.namespace.QName("urn:jbpm.org:jpdl-3.2", "state");
        private static final javax.xml.namespace.QName TASKNODE$10 = 
            new javax.xml.namespace.QName("urn:jbpm.org:jpdl-3.2", "task-node");
        private static final javax.xml.namespace.QName SUPERSTATE$12 = 
            new javax.xml.namespace.QName("urn:jbpm.org:jpdl-3.2", "super-state");
        private static final javax.xml.namespace.QName PROCESSSTATE$14 = 
            new javax.xml.namespace.QName("urn:jbpm.org:jpdl-3.2", "process-state");
        private static final javax.xml.namespace.QName FORK$16 = 
            new javax.xml.namespace.QName("urn:jbpm.org:jpdl-3.2", "fork");
        private static final javax.xml.namespace.QName JOIN$18 = 
            new javax.xml.namespace.QName("urn:jbpm.org:jpdl-3.2", "join");
        private static final javax.xml.namespace.QName DECISION$20 = 
            new javax.xml.namespace.QName("urn:jbpm.org:jpdl-3.2", "decision");
        private static final javax.xml.namespace.QName ENDSTATE$22 = 
            new javax.xml.namespace.QName("urn:jbpm.org:jpdl-3.2", "end-state");
        private static final javax.xml.namespace.QName MAILNODE$24 = 
            new javax.xml.namespace.QName("urn:jbpm.org:jpdl-3.2", "mail-node");
        private static final javax.xml.namespace.QName ACTION$26 = 
            new javax.xml.namespace.QName("urn:jbpm.org:jpdl-3.2", "action");
        private static final javax.xml.namespace.QName SCRIPT$28 = 
            new javax.xml.namespace.QName("urn:jbpm.org:jpdl-3.2", "script");
        private static final javax.xml.namespace.QName CREATETIMER$30 = 
            new javax.xml.namespace.QName("urn:jbpm.org:jpdl-3.2", "create-timer");
        private static final javax.xml.namespace.QName CANCELTIMER$32 = 
            new javax.xml.namespace.QName("urn:jbpm.org:jpdl-3.2", "cancel-timer");
        private static final javax.xml.namespace.QName MAIL$34 = 
            new javax.xml.namespace.QName("urn:jbpm.org:jpdl-3.2", "mail");
        private static final javax.xml.namespace.QName EVENT$36 = 
            new javax.xml.namespace.QName("urn:jbpm.org:jpdl-3.2", "event");
        private static final javax.xml.namespace.QName EXCEPTIONHANDLER$38 = 
            new javax.xml.namespace.QName("urn:jbpm.org:jpdl-3.2", "exception-handler");
        private static final javax.xml.namespace.QName TASK$40 = 
            new javax.xml.namespace.QName("urn:jbpm.org:jpdl-3.2", "task");
        private static final javax.xml.namespace.QName NAME$42 = 
            new javax.xml.namespace.QName("", "name");
        
        
        /**
         * Gets a List of "description" elements
         */
        public java.util.List<java.lang.String> getDescriptionList()
        {
            final class DescriptionList extends java.util.AbstractList<java.lang.String>
            {
                public java.lang.String get(int i)
                    { return ProcessDefinitionImpl.this.getDescriptionArray(i); }
                
                public java.lang.String set(int i, java.lang.String o)
                {
                    java.lang.String old = ProcessDefinitionImpl.this.getDescriptionArray(i);
                    ProcessDefinitionImpl.this.setDescriptionArray(i, o);
                    return old;
                }
                
                public void add(int i, java.lang.String o)
                    { ProcessDefinitionImpl.this.insertDescription(i, o); }
                
                public java.lang.String remove(int i)
                {
                    java.lang.String old = ProcessDefinitionImpl.this.getDescriptionArray(i);
                    ProcessDefinitionImpl.this.removeDescription(i);
                    return old;
                }
                
                public int size()
                    { return ProcessDefinitionImpl.this.sizeOfDescriptionArray(); }
                
            }
            
            synchronized (monitor())
            {
                check_orphaned();
                return new DescriptionList();
            }
        }
        
        /**
         * Gets array of all "description" elements
         * @deprecated
         */
        public java.lang.String[] getDescriptionArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List<org.apache.xmlbeans.XmlString> targetList = new java.util.ArrayList<org.apache.xmlbeans.XmlString>();
                get_store().find_all_element_users(DESCRIPTION$0, targetList);
                java.lang.String[] result = new java.lang.String[targetList.size()];
                for (int i = 0, len = targetList.size() ; i < len ; i++)
                    result[i] = ((org.apache.xmlbeans.SimpleValue)targetList.get(i)).getStringValue();
                return result;
            }
        }
        
        /**
         * Gets ith "description" element
         */
        public java.lang.String getDescriptionArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DESCRIPTION$0, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target.getStringValue();
            }
        }
        
        /**
         * Gets (as xml) a List of "description" elements
         */
        public java.util.List<org.apache.xmlbeans.XmlString> xgetDescriptionList()
        {
            final class DescriptionList extends java.util.AbstractList<org.apache.xmlbeans.XmlString>
            {
                public org.apache.xmlbeans.XmlString get(int i)
                    { return ProcessDefinitionImpl.this.xgetDescriptionArray(i); }
                
                public org.apache.xmlbeans.XmlString set(int i, org.apache.xmlbeans.XmlString o)
                {
                    org.apache.xmlbeans.XmlString old = ProcessDefinitionImpl.this.xgetDescriptionArray(i);
                    ProcessDefinitionImpl.this.xsetDescriptionArray(i, o);
                    return old;
                }
                
                public void add(int i, org.apache.xmlbeans.XmlString o)
                    { ProcessDefinitionImpl.this.insertNewDescription(i).set(o); }
                
                public org.apache.xmlbeans.XmlString remove(int i)
                {
                    org.apache.xmlbeans.XmlString old = ProcessDefinitionImpl.this.xgetDescriptionArray(i);
                    ProcessDefinitionImpl.this.removeDescription(i);
                    return old;
                }
                
                public int size()
                    { return ProcessDefinitionImpl.this.sizeOfDescriptionArray(); }
                
            }
            
            synchronized (monitor())
            {
                check_orphaned();
                return new DescriptionList();
            }
        }
        
        /**
         * Gets array of all "description" elements
         * @deprecated
         */
        public org.apache.xmlbeans.XmlString[] xgetDescriptionArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List<org.apache.xmlbeans.XmlString> targetList = new java.util.ArrayList<org.apache.xmlbeans.XmlString>();
                get_store().find_all_element_users(DESCRIPTION$0, targetList);
                org.apache.xmlbeans.XmlString[] result = new org.apache.xmlbeans.XmlString[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets (as xml) ith "description" element
         */
        public org.apache.xmlbeans.XmlString xgetDescriptionArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlString target = null;
                target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(DESCRIPTION$0, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return (org.apache.xmlbeans.XmlString)target;
            }
        }
        
        /**
         * Returns number of "description" element
         */
        public int sizeOfDescriptionArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(DESCRIPTION$0);
            }
        }
        
        /**
         * Sets array of all "description" element
         */
        public void setDescriptionArray(java.lang.String[] descriptionArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(descriptionArray, DESCRIPTION$0);
            }
        }
        
        /**
         * Sets ith "description" element
         */
        public void setDescriptionArray(int i, java.lang.String description)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DESCRIPTION$0, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.setStringValue(description);
            }
        }
        
        /**
         * Sets (as xml) array of all "description" element
         */
        public void xsetDescriptionArray(org.apache.xmlbeans.XmlString[]descriptionArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(descriptionArray, DESCRIPTION$0);
            }
        }
        
        /**
         * Sets (as xml) ith "description" element
         */
        public void xsetDescriptionArray(int i, org.apache.xmlbeans.XmlString description)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlString target = null;
                target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(DESCRIPTION$0, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(description);
            }
        }
        
        /**
         * Inserts the value as the ith "description" element
         */
        public void insertDescription(int i, java.lang.String description)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = 
                    (org.apache.xmlbeans.SimpleValue)get_store().insert_element_user(DESCRIPTION$0, i);
                target.setStringValue(description);
            }
        }
        
        /**
         * Appends the value as the last "description" element
         */
        public void addDescription(java.lang.String description)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(DESCRIPTION$0);
                target.setStringValue(description);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "description" element
         */
        public org.apache.xmlbeans.XmlString insertNewDescription(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlString target = null;
                target = (org.apache.xmlbeans.XmlString)get_store().insert_element_user(DESCRIPTION$0, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "description" element
         */
        public org.apache.xmlbeans.XmlString addNewDescription()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlString target = null;
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(DESCRIPTION$0);
                return target;
            }
        }
        
        /**
         * Removes the ith "description" element
         */
        public void removeDescription(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(DESCRIPTION$0, i);
            }
        }
        
        /**
         * Gets a List of "swimlane" elements
         */
        public java.util.List<x2.orgJpdl3.jbpm.SwimlaneDocument.Swimlane> getSwimlaneList()
        {
            final class SwimlaneList extends java.util.AbstractList<x2.orgJpdl3.jbpm.SwimlaneDocument.Swimlane>
            {
                public x2.orgJpdl3.jbpm.SwimlaneDocument.Swimlane get(int i)
                    { return ProcessDefinitionImpl.this.getSwimlaneArray(i); }
                
                public x2.orgJpdl3.jbpm.SwimlaneDocument.Swimlane set(int i, x2.orgJpdl3.jbpm.SwimlaneDocument.Swimlane o)
                {
                    x2.orgJpdl3.jbpm.SwimlaneDocument.Swimlane old = ProcessDefinitionImpl.this.getSwimlaneArray(i);
                    ProcessDefinitionImpl.this.setSwimlaneArray(i, o);
                    return old;
                }
                
                public void add(int i, x2.orgJpdl3.jbpm.SwimlaneDocument.Swimlane o)
                    { ProcessDefinitionImpl.this.insertNewSwimlane(i).set(o); }
                
                public x2.orgJpdl3.jbpm.SwimlaneDocument.Swimlane remove(int i)
                {
                    x2.orgJpdl3.jbpm.SwimlaneDocument.Swimlane old = ProcessDefinitionImpl.this.getSwimlaneArray(i);
                    ProcessDefinitionImpl.this.removeSwimlane(i);
                    return old;
                }
                
                public int size()
                    { return ProcessDefinitionImpl.this.sizeOfSwimlaneArray(); }
                
            }
            
            synchronized (monitor())
            {
                check_orphaned();
                return new SwimlaneList();
            }
        }
        
        /**
         * Gets array of all "swimlane" elements
         * @deprecated
         */
        public x2.orgJpdl3.jbpm.SwimlaneDocument.Swimlane[] getSwimlaneArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List<x2.orgJpdl3.jbpm.SwimlaneDocument.Swimlane> targetList = new java.util.ArrayList<x2.orgJpdl3.jbpm.SwimlaneDocument.Swimlane>();
                get_store().find_all_element_users(SWIMLANE$2, targetList);
                x2.orgJpdl3.jbpm.SwimlaneDocument.Swimlane[] result = new x2.orgJpdl3.jbpm.SwimlaneDocument.Swimlane[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "swimlane" element
         */
        public x2.orgJpdl3.jbpm.SwimlaneDocument.Swimlane getSwimlaneArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.SwimlaneDocument.Swimlane target = null;
                target = (x2.orgJpdl3.jbpm.SwimlaneDocument.Swimlane)get_store().find_element_user(SWIMLANE$2, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "swimlane" element
         */
        public int sizeOfSwimlaneArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(SWIMLANE$2);
            }
        }
        
        /**
         * Sets array of all "swimlane" element
         */
        public void setSwimlaneArray(x2.orgJpdl3.jbpm.SwimlaneDocument.Swimlane[] swimlaneArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(swimlaneArray, SWIMLANE$2);
            }
        }
        
        /**
         * Sets ith "swimlane" element
         */
        public void setSwimlaneArray(int i, x2.orgJpdl3.jbpm.SwimlaneDocument.Swimlane swimlane)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.SwimlaneDocument.Swimlane target = null;
                target = (x2.orgJpdl3.jbpm.SwimlaneDocument.Swimlane)get_store().find_element_user(SWIMLANE$2, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(swimlane);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "swimlane" element
         */
        public x2.orgJpdl3.jbpm.SwimlaneDocument.Swimlane insertNewSwimlane(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.SwimlaneDocument.Swimlane target = null;
                target = (x2.orgJpdl3.jbpm.SwimlaneDocument.Swimlane)get_store().insert_element_user(SWIMLANE$2, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "swimlane" element
         */
        public x2.orgJpdl3.jbpm.SwimlaneDocument.Swimlane addNewSwimlane()
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.SwimlaneDocument.Swimlane target = null;
                target = (x2.orgJpdl3.jbpm.SwimlaneDocument.Swimlane)get_store().add_element_user(SWIMLANE$2);
                return target;
            }
        }
        
        /**
         * Removes the ith "swimlane" element
         */
        public void removeSwimlane(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(SWIMLANE$2, i);
            }
        }
        
        /**
         * Gets a List of "start-state" elements
         */
        public java.util.List<x2.orgJpdl3.jbpm.StartStateDocument.StartState> getStartStateList()
        {
            final class StartStateList extends java.util.AbstractList<x2.orgJpdl3.jbpm.StartStateDocument.StartState>
            {
                public x2.orgJpdl3.jbpm.StartStateDocument.StartState get(int i)
                    { return ProcessDefinitionImpl.this.getStartStateArray(i); }
                
                public x2.orgJpdl3.jbpm.StartStateDocument.StartState set(int i, x2.orgJpdl3.jbpm.StartStateDocument.StartState o)
                {
                    x2.orgJpdl3.jbpm.StartStateDocument.StartState old = ProcessDefinitionImpl.this.getStartStateArray(i);
                    ProcessDefinitionImpl.this.setStartStateArray(i, o);
                    return old;
                }
                
                public void add(int i, x2.orgJpdl3.jbpm.StartStateDocument.StartState o)
                    { ProcessDefinitionImpl.this.insertNewStartState(i).set(o); }
                
                public x2.orgJpdl3.jbpm.StartStateDocument.StartState remove(int i)
                {
                    x2.orgJpdl3.jbpm.StartStateDocument.StartState old = ProcessDefinitionImpl.this.getStartStateArray(i);
                    ProcessDefinitionImpl.this.removeStartState(i);
                    return old;
                }
                
                public int size()
                    { return ProcessDefinitionImpl.this.sizeOfStartStateArray(); }
                
            }
            
            synchronized (monitor())
            {
                check_orphaned();
                return new StartStateList();
            }
        }
        
        /**
         * Gets array of all "start-state" elements
         * @deprecated
         */
        public x2.orgJpdl3.jbpm.StartStateDocument.StartState[] getStartStateArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List<x2.orgJpdl3.jbpm.StartStateDocument.StartState> targetList = new java.util.ArrayList<x2.orgJpdl3.jbpm.StartStateDocument.StartState>();
                get_store().find_all_element_users(STARTSTATE$4, targetList);
                x2.orgJpdl3.jbpm.StartStateDocument.StartState[] result = new x2.orgJpdl3.jbpm.StartStateDocument.StartState[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "start-state" element
         */
        public x2.orgJpdl3.jbpm.StartStateDocument.StartState getStartStateArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.StartStateDocument.StartState target = null;
                target = (x2.orgJpdl3.jbpm.StartStateDocument.StartState)get_store().find_element_user(STARTSTATE$4, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "start-state" element
         */
        public int sizeOfStartStateArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(STARTSTATE$4);
            }
        }
        
        /**
         * Sets array of all "start-state" element
         */
        public void setStartStateArray(x2.orgJpdl3.jbpm.StartStateDocument.StartState[] startStateArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(startStateArray, STARTSTATE$4);
            }
        }
        
        /**
         * Sets ith "start-state" element
         */
        public void setStartStateArray(int i, x2.orgJpdl3.jbpm.StartStateDocument.StartState startState)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.StartStateDocument.StartState target = null;
                target = (x2.orgJpdl3.jbpm.StartStateDocument.StartState)get_store().find_element_user(STARTSTATE$4, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(startState);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "start-state" element
         */
        public x2.orgJpdl3.jbpm.StartStateDocument.StartState insertNewStartState(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.StartStateDocument.StartState target = null;
                target = (x2.orgJpdl3.jbpm.StartStateDocument.StartState)get_store().insert_element_user(STARTSTATE$4, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "start-state" element
         */
        public x2.orgJpdl3.jbpm.StartStateDocument.StartState addNewStartState()
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.StartStateDocument.StartState target = null;
                target = (x2.orgJpdl3.jbpm.StartStateDocument.StartState)get_store().add_element_user(STARTSTATE$4);
                return target;
            }
        }
        
        /**
         * Removes the ith "start-state" element
         */
        public void removeStartState(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(STARTSTATE$4, i);
            }
        }
        
        /**
         * Gets a List of "node" elements
         */
        public java.util.List<x2.orgJpdl3.jbpm.NodeDocument.Node> getNodeList()
        {
            final class NodeList extends java.util.AbstractList<x2.orgJpdl3.jbpm.NodeDocument.Node>
            {
                public x2.orgJpdl3.jbpm.NodeDocument.Node get(int i)
                    { return ProcessDefinitionImpl.this.getNodeArray(i); }
                
                public x2.orgJpdl3.jbpm.NodeDocument.Node set(int i, x2.orgJpdl3.jbpm.NodeDocument.Node o)
                {
                    x2.orgJpdl3.jbpm.NodeDocument.Node old = ProcessDefinitionImpl.this.getNodeArray(i);
                    ProcessDefinitionImpl.this.setNodeArray(i, o);
                    return old;
                }
                
                public void add(int i, x2.orgJpdl3.jbpm.NodeDocument.Node o)
                    { ProcessDefinitionImpl.this.insertNewNode(i).set(o); }
                
                public x2.orgJpdl3.jbpm.NodeDocument.Node remove(int i)
                {
                    x2.orgJpdl3.jbpm.NodeDocument.Node old = ProcessDefinitionImpl.this.getNodeArray(i);
                    ProcessDefinitionImpl.this.removeNode(i);
                    return old;
                }
                
                public int size()
                    { return ProcessDefinitionImpl.this.sizeOfNodeArray(); }
                
            }
            
            synchronized (monitor())
            {
                check_orphaned();
                return new NodeList();
            }
        }
        
        /**
         * Gets array of all "node" elements
         * @deprecated
         */
        public x2.orgJpdl3.jbpm.NodeDocument.Node[] getNodeArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List<x2.orgJpdl3.jbpm.NodeDocument.Node> targetList = new java.util.ArrayList<x2.orgJpdl3.jbpm.NodeDocument.Node>();
                get_store().find_all_element_users(NODE$6, targetList);
                x2.orgJpdl3.jbpm.NodeDocument.Node[] result = new x2.orgJpdl3.jbpm.NodeDocument.Node[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "node" element
         */
        public x2.orgJpdl3.jbpm.NodeDocument.Node getNodeArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.NodeDocument.Node target = null;
                target = (x2.orgJpdl3.jbpm.NodeDocument.Node)get_store().find_element_user(NODE$6, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "node" element
         */
        public int sizeOfNodeArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(NODE$6);
            }
        }
        
        /**
         * Sets array of all "node" element
         */
        public void setNodeArray(x2.orgJpdl3.jbpm.NodeDocument.Node[] nodeArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(nodeArray, NODE$6);
            }
        }
        
        /**
         * Sets ith "node" element
         */
        public void setNodeArray(int i, x2.orgJpdl3.jbpm.NodeDocument.Node node)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.NodeDocument.Node target = null;
                target = (x2.orgJpdl3.jbpm.NodeDocument.Node)get_store().find_element_user(NODE$6, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(node);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "node" element
         */
        public x2.orgJpdl3.jbpm.NodeDocument.Node insertNewNode(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.NodeDocument.Node target = null;
                target = (x2.orgJpdl3.jbpm.NodeDocument.Node)get_store().insert_element_user(NODE$6, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "node" element
         */
        public x2.orgJpdl3.jbpm.NodeDocument.Node addNewNode()
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.NodeDocument.Node target = null;
                target = (x2.orgJpdl3.jbpm.NodeDocument.Node)get_store().add_element_user(NODE$6);
                return target;
            }
        }
        
        /**
         * Removes the ith "node" element
         */
        public void removeNode(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(NODE$6, i);
            }
        }
        
        /**
         * Gets a List of "state" elements
         */
        public java.util.List<x2.orgJpdl3.jbpm.StateDocument.State> getStateList()
        {
            final class StateList extends java.util.AbstractList<x2.orgJpdl3.jbpm.StateDocument.State>
            {
                public x2.orgJpdl3.jbpm.StateDocument.State get(int i)
                    { return ProcessDefinitionImpl.this.getStateArray(i); }
                
                public x2.orgJpdl3.jbpm.StateDocument.State set(int i, x2.orgJpdl3.jbpm.StateDocument.State o)
                {
                    x2.orgJpdl3.jbpm.StateDocument.State old = ProcessDefinitionImpl.this.getStateArray(i);
                    ProcessDefinitionImpl.this.setStateArray(i, o);
                    return old;
                }
                
                public void add(int i, x2.orgJpdl3.jbpm.StateDocument.State o)
                    { ProcessDefinitionImpl.this.insertNewState(i).set(o); }
                
                public x2.orgJpdl3.jbpm.StateDocument.State remove(int i)
                {
                    x2.orgJpdl3.jbpm.StateDocument.State old = ProcessDefinitionImpl.this.getStateArray(i);
                    ProcessDefinitionImpl.this.removeState(i);
                    return old;
                }
                
                public int size()
                    { return ProcessDefinitionImpl.this.sizeOfStateArray(); }
                
            }
            
            synchronized (monitor())
            {
                check_orphaned();
                return new StateList();
            }
        }
        
        /**
         * Gets array of all "state" elements
         * @deprecated
         */
        public x2.orgJpdl3.jbpm.StateDocument.State[] getStateArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List<x2.orgJpdl3.jbpm.StateDocument.State> targetList = new java.util.ArrayList<x2.orgJpdl3.jbpm.StateDocument.State>();
                get_store().find_all_element_users(STATE$8, targetList);
                x2.orgJpdl3.jbpm.StateDocument.State[] result = new x2.orgJpdl3.jbpm.StateDocument.State[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "state" element
         */
        public x2.orgJpdl3.jbpm.StateDocument.State getStateArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.StateDocument.State target = null;
                target = (x2.orgJpdl3.jbpm.StateDocument.State)get_store().find_element_user(STATE$8, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "state" element
         */
        public int sizeOfStateArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(STATE$8);
            }
        }
        
        /**
         * Sets array of all "state" element
         */
        public void setStateArray(x2.orgJpdl3.jbpm.StateDocument.State[] stateArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(stateArray, STATE$8);
            }
        }
        
        /**
         * Sets ith "state" element
         */
        public void setStateArray(int i, x2.orgJpdl3.jbpm.StateDocument.State state)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.StateDocument.State target = null;
                target = (x2.orgJpdl3.jbpm.StateDocument.State)get_store().find_element_user(STATE$8, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(state);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "state" element
         */
        public x2.orgJpdl3.jbpm.StateDocument.State insertNewState(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.StateDocument.State target = null;
                target = (x2.orgJpdl3.jbpm.StateDocument.State)get_store().insert_element_user(STATE$8, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "state" element
         */
        public x2.orgJpdl3.jbpm.StateDocument.State addNewState()
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.StateDocument.State target = null;
                target = (x2.orgJpdl3.jbpm.StateDocument.State)get_store().add_element_user(STATE$8);
                return target;
            }
        }
        
        /**
         * Removes the ith "state" element
         */
        public void removeState(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(STATE$8, i);
            }
        }
        
        /**
         * Gets a List of "task-node" elements
         */
        public java.util.List<x2.orgJpdl3.jbpm.TaskNodeDocument.TaskNode> getTaskNodeList()
        {
            final class TaskNodeList extends java.util.AbstractList<x2.orgJpdl3.jbpm.TaskNodeDocument.TaskNode>
            {
                public x2.orgJpdl3.jbpm.TaskNodeDocument.TaskNode get(int i)
                    { return ProcessDefinitionImpl.this.getTaskNodeArray(i); }
                
                public x2.orgJpdl3.jbpm.TaskNodeDocument.TaskNode set(int i, x2.orgJpdl3.jbpm.TaskNodeDocument.TaskNode o)
                {
                    x2.orgJpdl3.jbpm.TaskNodeDocument.TaskNode old = ProcessDefinitionImpl.this.getTaskNodeArray(i);
                    ProcessDefinitionImpl.this.setTaskNodeArray(i, o);
                    return old;
                }
                
                public void add(int i, x2.orgJpdl3.jbpm.TaskNodeDocument.TaskNode o)
                    { ProcessDefinitionImpl.this.insertNewTaskNode(i).set(o); }
                
                public x2.orgJpdl3.jbpm.TaskNodeDocument.TaskNode remove(int i)
                {
                    x2.orgJpdl3.jbpm.TaskNodeDocument.TaskNode old = ProcessDefinitionImpl.this.getTaskNodeArray(i);
                    ProcessDefinitionImpl.this.removeTaskNode(i);
                    return old;
                }
                
                public int size()
                    { return ProcessDefinitionImpl.this.sizeOfTaskNodeArray(); }
                
            }
            
            synchronized (monitor())
            {
                check_orphaned();
                return new TaskNodeList();
            }
        }
        
        /**
         * Gets array of all "task-node" elements
         * @deprecated
         */
        public x2.orgJpdl3.jbpm.TaskNodeDocument.TaskNode[] getTaskNodeArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List<x2.orgJpdl3.jbpm.TaskNodeDocument.TaskNode> targetList = new java.util.ArrayList<x2.orgJpdl3.jbpm.TaskNodeDocument.TaskNode>();
                get_store().find_all_element_users(TASKNODE$10, targetList);
                x2.orgJpdl3.jbpm.TaskNodeDocument.TaskNode[] result = new x2.orgJpdl3.jbpm.TaskNodeDocument.TaskNode[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "task-node" element
         */
        public x2.orgJpdl3.jbpm.TaskNodeDocument.TaskNode getTaskNodeArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.TaskNodeDocument.TaskNode target = null;
                target = (x2.orgJpdl3.jbpm.TaskNodeDocument.TaskNode)get_store().find_element_user(TASKNODE$10, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "task-node" element
         */
        public int sizeOfTaskNodeArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(TASKNODE$10);
            }
        }
        
        /**
         * Sets array of all "task-node" element
         */
        public void setTaskNodeArray(x2.orgJpdl3.jbpm.TaskNodeDocument.TaskNode[] taskNodeArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(taskNodeArray, TASKNODE$10);
            }
        }
        
        /**
         * Sets ith "task-node" element
         */
        public void setTaskNodeArray(int i, x2.orgJpdl3.jbpm.TaskNodeDocument.TaskNode taskNode)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.TaskNodeDocument.TaskNode target = null;
                target = (x2.orgJpdl3.jbpm.TaskNodeDocument.TaskNode)get_store().find_element_user(TASKNODE$10, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(taskNode);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "task-node" element
         */
        public x2.orgJpdl3.jbpm.TaskNodeDocument.TaskNode insertNewTaskNode(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.TaskNodeDocument.TaskNode target = null;
                target = (x2.orgJpdl3.jbpm.TaskNodeDocument.TaskNode)get_store().insert_element_user(TASKNODE$10, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "task-node" element
         */
        public x2.orgJpdl3.jbpm.TaskNodeDocument.TaskNode addNewTaskNode()
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.TaskNodeDocument.TaskNode target = null;
                target = (x2.orgJpdl3.jbpm.TaskNodeDocument.TaskNode)get_store().add_element_user(TASKNODE$10);
                return target;
            }
        }
        
        /**
         * Removes the ith "task-node" element
         */
        public void removeTaskNode(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(TASKNODE$10, i);
            }
        }
        
        /**
         * Gets a List of "super-state" elements
         */
        public java.util.List<x2.orgJpdl3.jbpm.SuperStateDocument.SuperState> getSuperStateList()
        {
            final class SuperStateList extends java.util.AbstractList<x2.orgJpdl3.jbpm.SuperStateDocument.SuperState>
            {
                public x2.orgJpdl3.jbpm.SuperStateDocument.SuperState get(int i)
                    { return ProcessDefinitionImpl.this.getSuperStateArray(i); }
                
                public x2.orgJpdl3.jbpm.SuperStateDocument.SuperState set(int i, x2.orgJpdl3.jbpm.SuperStateDocument.SuperState o)
                {
                    x2.orgJpdl3.jbpm.SuperStateDocument.SuperState old = ProcessDefinitionImpl.this.getSuperStateArray(i);
                    ProcessDefinitionImpl.this.setSuperStateArray(i, o);
                    return old;
                }
                
                public void add(int i, x2.orgJpdl3.jbpm.SuperStateDocument.SuperState o)
                    { ProcessDefinitionImpl.this.insertNewSuperState(i).set(o); }
                
                public x2.orgJpdl3.jbpm.SuperStateDocument.SuperState remove(int i)
                {
                    x2.orgJpdl3.jbpm.SuperStateDocument.SuperState old = ProcessDefinitionImpl.this.getSuperStateArray(i);
                    ProcessDefinitionImpl.this.removeSuperState(i);
                    return old;
                }
                
                public int size()
                    { return ProcessDefinitionImpl.this.sizeOfSuperStateArray(); }
                
            }
            
            synchronized (monitor())
            {
                check_orphaned();
                return new SuperStateList();
            }
        }
        
        /**
         * Gets array of all "super-state" elements
         * @deprecated
         */
        public x2.orgJpdl3.jbpm.SuperStateDocument.SuperState[] getSuperStateArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List<x2.orgJpdl3.jbpm.SuperStateDocument.SuperState> targetList = new java.util.ArrayList<x2.orgJpdl3.jbpm.SuperStateDocument.SuperState>();
                get_store().find_all_element_users(SUPERSTATE$12, targetList);
                x2.orgJpdl3.jbpm.SuperStateDocument.SuperState[] result = new x2.orgJpdl3.jbpm.SuperStateDocument.SuperState[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "super-state" element
         */
        public x2.orgJpdl3.jbpm.SuperStateDocument.SuperState getSuperStateArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.SuperStateDocument.SuperState target = null;
                target = (x2.orgJpdl3.jbpm.SuperStateDocument.SuperState)get_store().find_element_user(SUPERSTATE$12, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "super-state" element
         */
        public int sizeOfSuperStateArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(SUPERSTATE$12);
            }
        }
        
        /**
         * Sets array of all "super-state" element
         */
        public void setSuperStateArray(x2.orgJpdl3.jbpm.SuperStateDocument.SuperState[] superStateArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(superStateArray, SUPERSTATE$12);
            }
        }
        
        /**
         * Sets ith "super-state" element
         */
        public void setSuperStateArray(int i, x2.orgJpdl3.jbpm.SuperStateDocument.SuperState superState)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.SuperStateDocument.SuperState target = null;
                target = (x2.orgJpdl3.jbpm.SuperStateDocument.SuperState)get_store().find_element_user(SUPERSTATE$12, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(superState);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "super-state" element
         */
        public x2.orgJpdl3.jbpm.SuperStateDocument.SuperState insertNewSuperState(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.SuperStateDocument.SuperState target = null;
                target = (x2.orgJpdl3.jbpm.SuperStateDocument.SuperState)get_store().insert_element_user(SUPERSTATE$12, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "super-state" element
         */
        public x2.orgJpdl3.jbpm.SuperStateDocument.SuperState addNewSuperState()
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.SuperStateDocument.SuperState target = null;
                target = (x2.orgJpdl3.jbpm.SuperStateDocument.SuperState)get_store().add_element_user(SUPERSTATE$12);
                return target;
            }
        }
        
        /**
         * Removes the ith "super-state" element
         */
        public void removeSuperState(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(SUPERSTATE$12, i);
            }
        }
        
        /**
         * Gets a List of "process-state" elements
         */
        public java.util.List<x2.orgJpdl3.jbpm.ProcessStateDocument.ProcessState> getProcessStateList()
        {
            final class ProcessStateList extends java.util.AbstractList<x2.orgJpdl3.jbpm.ProcessStateDocument.ProcessState>
            {
                public x2.orgJpdl3.jbpm.ProcessStateDocument.ProcessState get(int i)
                    { return ProcessDefinitionImpl.this.getProcessStateArray(i); }
                
                public x2.orgJpdl3.jbpm.ProcessStateDocument.ProcessState set(int i, x2.orgJpdl3.jbpm.ProcessStateDocument.ProcessState o)
                {
                    x2.orgJpdl3.jbpm.ProcessStateDocument.ProcessState old = ProcessDefinitionImpl.this.getProcessStateArray(i);
                    ProcessDefinitionImpl.this.setProcessStateArray(i, o);
                    return old;
                }
                
                public void add(int i, x2.orgJpdl3.jbpm.ProcessStateDocument.ProcessState o)
                    { ProcessDefinitionImpl.this.insertNewProcessState(i).set(o); }
                
                public x2.orgJpdl3.jbpm.ProcessStateDocument.ProcessState remove(int i)
                {
                    x2.orgJpdl3.jbpm.ProcessStateDocument.ProcessState old = ProcessDefinitionImpl.this.getProcessStateArray(i);
                    ProcessDefinitionImpl.this.removeProcessState(i);
                    return old;
                }
                
                public int size()
                    { return ProcessDefinitionImpl.this.sizeOfProcessStateArray(); }
                
            }
            
            synchronized (monitor())
            {
                check_orphaned();
                return new ProcessStateList();
            }
        }
        
        /**
         * Gets array of all "process-state" elements
         * @deprecated
         */
        public x2.orgJpdl3.jbpm.ProcessStateDocument.ProcessState[] getProcessStateArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List<x2.orgJpdl3.jbpm.ProcessStateDocument.ProcessState> targetList = new java.util.ArrayList<x2.orgJpdl3.jbpm.ProcessStateDocument.ProcessState>();
                get_store().find_all_element_users(PROCESSSTATE$14, targetList);
                x2.orgJpdl3.jbpm.ProcessStateDocument.ProcessState[] result = new x2.orgJpdl3.jbpm.ProcessStateDocument.ProcessState[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "process-state" element
         */
        public x2.orgJpdl3.jbpm.ProcessStateDocument.ProcessState getProcessStateArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.ProcessStateDocument.ProcessState target = null;
                target = (x2.orgJpdl3.jbpm.ProcessStateDocument.ProcessState)get_store().find_element_user(PROCESSSTATE$14, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "process-state" element
         */
        public int sizeOfProcessStateArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(PROCESSSTATE$14);
            }
        }
        
        /**
         * Sets array of all "process-state" element
         */
        public void setProcessStateArray(x2.orgJpdl3.jbpm.ProcessStateDocument.ProcessState[] processStateArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(processStateArray, PROCESSSTATE$14);
            }
        }
        
        /**
         * Sets ith "process-state" element
         */
        public void setProcessStateArray(int i, x2.orgJpdl3.jbpm.ProcessStateDocument.ProcessState processState)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.ProcessStateDocument.ProcessState target = null;
                target = (x2.orgJpdl3.jbpm.ProcessStateDocument.ProcessState)get_store().find_element_user(PROCESSSTATE$14, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(processState);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "process-state" element
         */
        public x2.orgJpdl3.jbpm.ProcessStateDocument.ProcessState insertNewProcessState(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.ProcessStateDocument.ProcessState target = null;
                target = (x2.orgJpdl3.jbpm.ProcessStateDocument.ProcessState)get_store().insert_element_user(PROCESSSTATE$14, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "process-state" element
         */
        public x2.orgJpdl3.jbpm.ProcessStateDocument.ProcessState addNewProcessState()
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.ProcessStateDocument.ProcessState target = null;
                target = (x2.orgJpdl3.jbpm.ProcessStateDocument.ProcessState)get_store().add_element_user(PROCESSSTATE$14);
                return target;
            }
        }
        
        /**
         * Removes the ith "process-state" element
         */
        public void removeProcessState(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(PROCESSSTATE$14, i);
            }
        }
        
        /**
         * Gets a List of "fork" elements
         */
        public java.util.List<x2.orgJpdl3.jbpm.ForkDocument.Fork> getForkList()
        {
            final class ForkList extends java.util.AbstractList<x2.orgJpdl3.jbpm.ForkDocument.Fork>
            {
                public x2.orgJpdl3.jbpm.ForkDocument.Fork get(int i)
                    { return ProcessDefinitionImpl.this.getForkArray(i); }
                
                public x2.orgJpdl3.jbpm.ForkDocument.Fork set(int i, x2.orgJpdl3.jbpm.ForkDocument.Fork o)
                {
                    x2.orgJpdl3.jbpm.ForkDocument.Fork old = ProcessDefinitionImpl.this.getForkArray(i);
                    ProcessDefinitionImpl.this.setForkArray(i, o);
                    return old;
                }
                
                public void add(int i, x2.orgJpdl3.jbpm.ForkDocument.Fork o)
                    { ProcessDefinitionImpl.this.insertNewFork(i).set(o); }
                
                public x2.orgJpdl3.jbpm.ForkDocument.Fork remove(int i)
                {
                    x2.orgJpdl3.jbpm.ForkDocument.Fork old = ProcessDefinitionImpl.this.getForkArray(i);
                    ProcessDefinitionImpl.this.removeFork(i);
                    return old;
                }
                
                public int size()
                    { return ProcessDefinitionImpl.this.sizeOfForkArray(); }
                
            }
            
            synchronized (monitor())
            {
                check_orphaned();
                return new ForkList();
            }
        }
        
        /**
         * Gets array of all "fork" elements
         * @deprecated
         */
        public x2.orgJpdl3.jbpm.ForkDocument.Fork[] getForkArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List<x2.orgJpdl3.jbpm.ForkDocument.Fork> targetList = new java.util.ArrayList<x2.orgJpdl3.jbpm.ForkDocument.Fork>();
                get_store().find_all_element_users(FORK$16, targetList);
                x2.orgJpdl3.jbpm.ForkDocument.Fork[] result = new x2.orgJpdl3.jbpm.ForkDocument.Fork[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "fork" element
         */
        public x2.orgJpdl3.jbpm.ForkDocument.Fork getForkArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.ForkDocument.Fork target = null;
                target = (x2.orgJpdl3.jbpm.ForkDocument.Fork)get_store().find_element_user(FORK$16, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "fork" element
         */
        public int sizeOfForkArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(FORK$16);
            }
        }
        
        /**
         * Sets array of all "fork" element
         */
        public void setForkArray(x2.orgJpdl3.jbpm.ForkDocument.Fork[] forkArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(forkArray, FORK$16);
            }
        }
        
        /**
         * Sets ith "fork" element
         */
        public void setForkArray(int i, x2.orgJpdl3.jbpm.ForkDocument.Fork fork)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.ForkDocument.Fork target = null;
                target = (x2.orgJpdl3.jbpm.ForkDocument.Fork)get_store().find_element_user(FORK$16, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(fork);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "fork" element
         */
        public x2.orgJpdl3.jbpm.ForkDocument.Fork insertNewFork(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.ForkDocument.Fork target = null;
                target = (x2.orgJpdl3.jbpm.ForkDocument.Fork)get_store().insert_element_user(FORK$16, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "fork" element
         */
        public x2.orgJpdl3.jbpm.ForkDocument.Fork addNewFork()
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.ForkDocument.Fork target = null;
                target = (x2.orgJpdl3.jbpm.ForkDocument.Fork)get_store().add_element_user(FORK$16);
                return target;
            }
        }
        
        /**
         * Removes the ith "fork" element
         */
        public void removeFork(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(FORK$16, i);
            }
        }
        
        /**
         * Gets a List of "join" elements
         */
        public java.util.List<x2.orgJpdl3.jbpm.JoinDocument.Join> getJoinList()
        {
            final class JoinList extends java.util.AbstractList<x2.orgJpdl3.jbpm.JoinDocument.Join>
            {
                public x2.orgJpdl3.jbpm.JoinDocument.Join get(int i)
                    { return ProcessDefinitionImpl.this.getJoinArray(i); }
                
                public x2.orgJpdl3.jbpm.JoinDocument.Join set(int i, x2.orgJpdl3.jbpm.JoinDocument.Join o)
                {
                    x2.orgJpdl3.jbpm.JoinDocument.Join old = ProcessDefinitionImpl.this.getJoinArray(i);
                    ProcessDefinitionImpl.this.setJoinArray(i, o);
                    return old;
                }
                
                public void add(int i, x2.orgJpdl3.jbpm.JoinDocument.Join o)
                    { ProcessDefinitionImpl.this.insertNewJoin(i).set(o); }
                
                public x2.orgJpdl3.jbpm.JoinDocument.Join remove(int i)
                {
                    x2.orgJpdl3.jbpm.JoinDocument.Join old = ProcessDefinitionImpl.this.getJoinArray(i);
                    ProcessDefinitionImpl.this.removeJoin(i);
                    return old;
                }
                
                public int size()
                    { return ProcessDefinitionImpl.this.sizeOfJoinArray(); }
                
            }
            
            synchronized (monitor())
            {
                check_orphaned();
                return new JoinList();
            }
        }
        
        /**
         * Gets array of all "join" elements
         * @deprecated
         */
        public x2.orgJpdl3.jbpm.JoinDocument.Join[] getJoinArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List<x2.orgJpdl3.jbpm.JoinDocument.Join> targetList = new java.util.ArrayList<x2.orgJpdl3.jbpm.JoinDocument.Join>();
                get_store().find_all_element_users(JOIN$18, targetList);
                x2.orgJpdl3.jbpm.JoinDocument.Join[] result = new x2.orgJpdl3.jbpm.JoinDocument.Join[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "join" element
         */
        public x2.orgJpdl3.jbpm.JoinDocument.Join getJoinArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.JoinDocument.Join target = null;
                target = (x2.orgJpdl3.jbpm.JoinDocument.Join)get_store().find_element_user(JOIN$18, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "join" element
         */
        public int sizeOfJoinArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(JOIN$18);
            }
        }
        
        /**
         * Sets array of all "join" element
         */
        public void setJoinArray(x2.orgJpdl3.jbpm.JoinDocument.Join[] joinArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(joinArray, JOIN$18);
            }
        }
        
        /**
         * Sets ith "join" element
         */
        public void setJoinArray(int i, x2.orgJpdl3.jbpm.JoinDocument.Join join)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.JoinDocument.Join target = null;
                target = (x2.orgJpdl3.jbpm.JoinDocument.Join)get_store().find_element_user(JOIN$18, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(join);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "join" element
         */
        public x2.orgJpdl3.jbpm.JoinDocument.Join insertNewJoin(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.JoinDocument.Join target = null;
                target = (x2.orgJpdl3.jbpm.JoinDocument.Join)get_store().insert_element_user(JOIN$18, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "join" element
         */
        public x2.orgJpdl3.jbpm.JoinDocument.Join addNewJoin()
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.JoinDocument.Join target = null;
                target = (x2.orgJpdl3.jbpm.JoinDocument.Join)get_store().add_element_user(JOIN$18);
                return target;
            }
        }
        
        /**
         * Removes the ith "join" element
         */
        public void removeJoin(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(JOIN$18, i);
            }
        }
        
        /**
         * Gets a List of "decision" elements
         */
        public java.util.List<x2.orgJpdl3.jbpm.DecisionDocument.Decision> getDecisionList()
        {
            final class DecisionList extends java.util.AbstractList<x2.orgJpdl3.jbpm.DecisionDocument.Decision>
            {
                public x2.orgJpdl3.jbpm.DecisionDocument.Decision get(int i)
                    { return ProcessDefinitionImpl.this.getDecisionArray(i); }
                
                public x2.orgJpdl3.jbpm.DecisionDocument.Decision set(int i, x2.orgJpdl3.jbpm.DecisionDocument.Decision o)
                {
                    x2.orgJpdl3.jbpm.DecisionDocument.Decision old = ProcessDefinitionImpl.this.getDecisionArray(i);
                    ProcessDefinitionImpl.this.setDecisionArray(i, o);
                    return old;
                }
                
                public void add(int i, x2.orgJpdl3.jbpm.DecisionDocument.Decision o)
                    { ProcessDefinitionImpl.this.insertNewDecision(i).set(o); }
                
                public x2.orgJpdl3.jbpm.DecisionDocument.Decision remove(int i)
                {
                    x2.orgJpdl3.jbpm.DecisionDocument.Decision old = ProcessDefinitionImpl.this.getDecisionArray(i);
                    ProcessDefinitionImpl.this.removeDecision(i);
                    return old;
                }
                
                public int size()
                    { return ProcessDefinitionImpl.this.sizeOfDecisionArray(); }
                
            }
            
            synchronized (monitor())
            {
                check_orphaned();
                return new DecisionList();
            }
        }
        
        /**
         * Gets array of all "decision" elements
         * @deprecated
         */
        public x2.orgJpdl3.jbpm.DecisionDocument.Decision[] getDecisionArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List<x2.orgJpdl3.jbpm.DecisionDocument.Decision> targetList = new java.util.ArrayList<x2.orgJpdl3.jbpm.DecisionDocument.Decision>();
                get_store().find_all_element_users(DECISION$20, targetList);
                x2.orgJpdl3.jbpm.DecisionDocument.Decision[] result = new x2.orgJpdl3.jbpm.DecisionDocument.Decision[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "decision" element
         */
        public x2.orgJpdl3.jbpm.DecisionDocument.Decision getDecisionArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.DecisionDocument.Decision target = null;
                target = (x2.orgJpdl3.jbpm.DecisionDocument.Decision)get_store().find_element_user(DECISION$20, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "decision" element
         */
        public int sizeOfDecisionArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(DECISION$20);
            }
        }
        
        /**
         * Sets array of all "decision" element
         */
        public void setDecisionArray(x2.orgJpdl3.jbpm.DecisionDocument.Decision[] decisionArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(decisionArray, DECISION$20);
            }
        }
        
        /**
         * Sets ith "decision" element
         */
        public void setDecisionArray(int i, x2.orgJpdl3.jbpm.DecisionDocument.Decision decision)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.DecisionDocument.Decision target = null;
                target = (x2.orgJpdl3.jbpm.DecisionDocument.Decision)get_store().find_element_user(DECISION$20, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(decision);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "decision" element
         */
        public x2.orgJpdl3.jbpm.DecisionDocument.Decision insertNewDecision(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.DecisionDocument.Decision target = null;
                target = (x2.orgJpdl3.jbpm.DecisionDocument.Decision)get_store().insert_element_user(DECISION$20, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "decision" element
         */
        public x2.orgJpdl3.jbpm.DecisionDocument.Decision addNewDecision()
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.DecisionDocument.Decision target = null;
                target = (x2.orgJpdl3.jbpm.DecisionDocument.Decision)get_store().add_element_user(DECISION$20);
                return target;
            }
        }
        
        /**
         * Removes the ith "decision" element
         */
        public void removeDecision(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(DECISION$20, i);
            }
        }
        
        /**
         * Gets a List of "end-state" elements
         */
        public java.util.List<x2.orgJpdl3.jbpm.EndStateDocument.EndState> getEndStateList()
        {
            final class EndStateList extends java.util.AbstractList<x2.orgJpdl3.jbpm.EndStateDocument.EndState>
            {
                public x2.orgJpdl3.jbpm.EndStateDocument.EndState get(int i)
                    { return ProcessDefinitionImpl.this.getEndStateArray(i); }
                
                public x2.orgJpdl3.jbpm.EndStateDocument.EndState set(int i, x2.orgJpdl3.jbpm.EndStateDocument.EndState o)
                {
                    x2.orgJpdl3.jbpm.EndStateDocument.EndState old = ProcessDefinitionImpl.this.getEndStateArray(i);
                    ProcessDefinitionImpl.this.setEndStateArray(i, o);
                    return old;
                }
                
                public void add(int i, x2.orgJpdl3.jbpm.EndStateDocument.EndState o)
                    { ProcessDefinitionImpl.this.insertNewEndState(i).set(o); }
                
                public x2.orgJpdl3.jbpm.EndStateDocument.EndState remove(int i)
                {
                    x2.orgJpdl3.jbpm.EndStateDocument.EndState old = ProcessDefinitionImpl.this.getEndStateArray(i);
                    ProcessDefinitionImpl.this.removeEndState(i);
                    return old;
                }
                
                public int size()
                    { return ProcessDefinitionImpl.this.sizeOfEndStateArray(); }
                
            }
            
            synchronized (monitor())
            {
                check_orphaned();
                return new EndStateList();
            }
        }
        
        /**
         * Gets array of all "end-state" elements
         * @deprecated
         */
        public x2.orgJpdl3.jbpm.EndStateDocument.EndState[] getEndStateArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List<x2.orgJpdl3.jbpm.EndStateDocument.EndState> targetList = new java.util.ArrayList<x2.orgJpdl3.jbpm.EndStateDocument.EndState>();
                get_store().find_all_element_users(ENDSTATE$22, targetList);
                x2.orgJpdl3.jbpm.EndStateDocument.EndState[] result = new x2.orgJpdl3.jbpm.EndStateDocument.EndState[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "end-state" element
         */
        public x2.orgJpdl3.jbpm.EndStateDocument.EndState getEndStateArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.EndStateDocument.EndState target = null;
                target = (x2.orgJpdl3.jbpm.EndStateDocument.EndState)get_store().find_element_user(ENDSTATE$22, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "end-state" element
         */
        public int sizeOfEndStateArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(ENDSTATE$22);
            }
        }
        
        /**
         * Sets array of all "end-state" element
         */
        public void setEndStateArray(x2.orgJpdl3.jbpm.EndStateDocument.EndState[] endStateArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(endStateArray, ENDSTATE$22);
            }
        }
        
        /**
         * Sets ith "end-state" element
         */
        public void setEndStateArray(int i, x2.orgJpdl3.jbpm.EndStateDocument.EndState endState)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.EndStateDocument.EndState target = null;
                target = (x2.orgJpdl3.jbpm.EndStateDocument.EndState)get_store().find_element_user(ENDSTATE$22, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(endState);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "end-state" element
         */
        public x2.orgJpdl3.jbpm.EndStateDocument.EndState insertNewEndState(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.EndStateDocument.EndState target = null;
                target = (x2.orgJpdl3.jbpm.EndStateDocument.EndState)get_store().insert_element_user(ENDSTATE$22, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "end-state" element
         */
        public x2.orgJpdl3.jbpm.EndStateDocument.EndState addNewEndState()
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.EndStateDocument.EndState target = null;
                target = (x2.orgJpdl3.jbpm.EndStateDocument.EndState)get_store().add_element_user(ENDSTATE$22);
                return target;
            }
        }
        
        /**
         * Removes the ith "end-state" element
         */
        public void removeEndState(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(ENDSTATE$22, i);
            }
        }
        
        /**
         * Gets a List of "mail-node" elements
         */
        public java.util.List<x2.orgJpdl3.jbpm.MailNodeDocument.MailNode> getMailNodeList()
        {
            final class MailNodeList extends java.util.AbstractList<x2.orgJpdl3.jbpm.MailNodeDocument.MailNode>
            {
                public x2.orgJpdl3.jbpm.MailNodeDocument.MailNode get(int i)
                    { return ProcessDefinitionImpl.this.getMailNodeArray(i); }
                
                public x2.orgJpdl3.jbpm.MailNodeDocument.MailNode set(int i, x2.orgJpdl3.jbpm.MailNodeDocument.MailNode o)
                {
                    x2.orgJpdl3.jbpm.MailNodeDocument.MailNode old = ProcessDefinitionImpl.this.getMailNodeArray(i);
                    ProcessDefinitionImpl.this.setMailNodeArray(i, o);
                    return old;
                }
                
                public void add(int i, x2.orgJpdl3.jbpm.MailNodeDocument.MailNode o)
                    { ProcessDefinitionImpl.this.insertNewMailNode(i).set(o); }
                
                public x2.orgJpdl3.jbpm.MailNodeDocument.MailNode remove(int i)
                {
                    x2.orgJpdl3.jbpm.MailNodeDocument.MailNode old = ProcessDefinitionImpl.this.getMailNodeArray(i);
                    ProcessDefinitionImpl.this.removeMailNode(i);
                    return old;
                }
                
                public int size()
                    { return ProcessDefinitionImpl.this.sizeOfMailNodeArray(); }
                
            }
            
            synchronized (monitor())
            {
                check_orphaned();
                return new MailNodeList();
            }
        }
        
        /**
         * Gets array of all "mail-node" elements
         * @deprecated
         */
        public x2.orgJpdl3.jbpm.MailNodeDocument.MailNode[] getMailNodeArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List<x2.orgJpdl3.jbpm.MailNodeDocument.MailNode> targetList = new java.util.ArrayList<x2.orgJpdl3.jbpm.MailNodeDocument.MailNode>();
                get_store().find_all_element_users(MAILNODE$24, targetList);
                x2.orgJpdl3.jbpm.MailNodeDocument.MailNode[] result = new x2.orgJpdl3.jbpm.MailNodeDocument.MailNode[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "mail-node" element
         */
        public x2.orgJpdl3.jbpm.MailNodeDocument.MailNode getMailNodeArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.MailNodeDocument.MailNode target = null;
                target = (x2.orgJpdl3.jbpm.MailNodeDocument.MailNode)get_store().find_element_user(MAILNODE$24, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "mail-node" element
         */
        public int sizeOfMailNodeArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(MAILNODE$24);
            }
        }
        
        /**
         * Sets array of all "mail-node" element
         */
        public void setMailNodeArray(x2.orgJpdl3.jbpm.MailNodeDocument.MailNode[] mailNodeArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(mailNodeArray, MAILNODE$24);
            }
        }
        
        /**
         * Sets ith "mail-node" element
         */
        public void setMailNodeArray(int i, x2.orgJpdl3.jbpm.MailNodeDocument.MailNode mailNode)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.MailNodeDocument.MailNode target = null;
                target = (x2.orgJpdl3.jbpm.MailNodeDocument.MailNode)get_store().find_element_user(MAILNODE$24, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(mailNode);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "mail-node" element
         */
        public x2.orgJpdl3.jbpm.MailNodeDocument.MailNode insertNewMailNode(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.MailNodeDocument.MailNode target = null;
                target = (x2.orgJpdl3.jbpm.MailNodeDocument.MailNode)get_store().insert_element_user(MAILNODE$24, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "mail-node" element
         */
        public x2.orgJpdl3.jbpm.MailNodeDocument.MailNode addNewMailNode()
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.MailNodeDocument.MailNode target = null;
                target = (x2.orgJpdl3.jbpm.MailNodeDocument.MailNode)get_store().add_element_user(MAILNODE$24);
                return target;
            }
        }
        
        /**
         * Removes the ith "mail-node" element
         */
        public void removeMailNode(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(MAILNODE$24, i);
            }
        }
        
        /**
         * Gets a List of "action" elements
         */
        public java.util.List<x2.orgJpdl3.jbpm.ActionDocument.Action> getActionList()
        {
            final class ActionList extends java.util.AbstractList<x2.orgJpdl3.jbpm.ActionDocument.Action>
            {
                public x2.orgJpdl3.jbpm.ActionDocument.Action get(int i)
                    { return ProcessDefinitionImpl.this.getActionArray(i); }
                
                public x2.orgJpdl3.jbpm.ActionDocument.Action set(int i, x2.orgJpdl3.jbpm.ActionDocument.Action o)
                {
                    x2.orgJpdl3.jbpm.ActionDocument.Action old = ProcessDefinitionImpl.this.getActionArray(i);
                    ProcessDefinitionImpl.this.setActionArray(i, o);
                    return old;
                }
                
                public void add(int i, x2.orgJpdl3.jbpm.ActionDocument.Action o)
                    { ProcessDefinitionImpl.this.insertNewAction(i).set(o); }
                
                public x2.orgJpdl3.jbpm.ActionDocument.Action remove(int i)
                {
                    x2.orgJpdl3.jbpm.ActionDocument.Action old = ProcessDefinitionImpl.this.getActionArray(i);
                    ProcessDefinitionImpl.this.removeAction(i);
                    return old;
                }
                
                public int size()
                    { return ProcessDefinitionImpl.this.sizeOfActionArray(); }
                
            }
            
            synchronized (monitor())
            {
                check_orphaned();
                return new ActionList();
            }
        }
        
        /**
         * Gets array of all "action" elements
         * @deprecated
         */
        public x2.orgJpdl3.jbpm.ActionDocument.Action[] getActionArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List<x2.orgJpdl3.jbpm.ActionDocument.Action> targetList = new java.util.ArrayList<x2.orgJpdl3.jbpm.ActionDocument.Action>();
                get_store().find_all_element_users(ACTION$26, targetList);
                x2.orgJpdl3.jbpm.ActionDocument.Action[] result = new x2.orgJpdl3.jbpm.ActionDocument.Action[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "action" element
         */
        public x2.orgJpdl3.jbpm.ActionDocument.Action getActionArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.ActionDocument.Action target = null;
                target = (x2.orgJpdl3.jbpm.ActionDocument.Action)get_store().find_element_user(ACTION$26, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "action" element
         */
        public int sizeOfActionArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(ACTION$26);
            }
        }
        
        /**
         * Sets array of all "action" element
         */
        public void setActionArray(x2.orgJpdl3.jbpm.ActionDocument.Action[] actionArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(actionArray, ACTION$26);
            }
        }
        
        /**
         * Sets ith "action" element
         */
        public void setActionArray(int i, x2.orgJpdl3.jbpm.ActionDocument.Action action)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.ActionDocument.Action target = null;
                target = (x2.orgJpdl3.jbpm.ActionDocument.Action)get_store().find_element_user(ACTION$26, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(action);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "action" element
         */
        public x2.orgJpdl3.jbpm.ActionDocument.Action insertNewAction(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.ActionDocument.Action target = null;
                target = (x2.orgJpdl3.jbpm.ActionDocument.Action)get_store().insert_element_user(ACTION$26, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "action" element
         */
        public x2.orgJpdl3.jbpm.ActionDocument.Action addNewAction()
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.ActionDocument.Action target = null;
                target = (x2.orgJpdl3.jbpm.ActionDocument.Action)get_store().add_element_user(ACTION$26);
                return target;
            }
        }
        
        /**
         * Removes the ith "action" element
         */
        public void removeAction(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(ACTION$26, i);
            }
        }
        
        /**
         * Gets a List of "script" elements
         */
        public java.util.List<x2.orgJpdl3.jbpm.ScriptDocument.Script> getScriptList()
        {
            final class ScriptList extends java.util.AbstractList<x2.orgJpdl3.jbpm.ScriptDocument.Script>
            {
                public x2.orgJpdl3.jbpm.ScriptDocument.Script get(int i)
                    { return ProcessDefinitionImpl.this.getScriptArray(i); }
                
                public x2.orgJpdl3.jbpm.ScriptDocument.Script set(int i, x2.orgJpdl3.jbpm.ScriptDocument.Script o)
                {
                    x2.orgJpdl3.jbpm.ScriptDocument.Script old = ProcessDefinitionImpl.this.getScriptArray(i);
                    ProcessDefinitionImpl.this.setScriptArray(i, o);
                    return old;
                }
                
                public void add(int i, x2.orgJpdl3.jbpm.ScriptDocument.Script o)
                    { ProcessDefinitionImpl.this.insertNewScript(i).set(o); }
                
                public x2.orgJpdl3.jbpm.ScriptDocument.Script remove(int i)
                {
                    x2.orgJpdl3.jbpm.ScriptDocument.Script old = ProcessDefinitionImpl.this.getScriptArray(i);
                    ProcessDefinitionImpl.this.removeScript(i);
                    return old;
                }
                
                public int size()
                    { return ProcessDefinitionImpl.this.sizeOfScriptArray(); }
                
            }
            
            synchronized (monitor())
            {
                check_orphaned();
                return new ScriptList();
            }
        }
        
        /**
         * Gets array of all "script" elements
         * @deprecated
         */
        public x2.orgJpdl3.jbpm.ScriptDocument.Script[] getScriptArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List<x2.orgJpdl3.jbpm.ScriptDocument.Script> targetList = new java.util.ArrayList<x2.orgJpdl3.jbpm.ScriptDocument.Script>();
                get_store().find_all_element_users(SCRIPT$28, targetList);
                x2.orgJpdl3.jbpm.ScriptDocument.Script[] result = new x2.orgJpdl3.jbpm.ScriptDocument.Script[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "script" element
         */
        public x2.orgJpdl3.jbpm.ScriptDocument.Script getScriptArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.ScriptDocument.Script target = null;
                target = (x2.orgJpdl3.jbpm.ScriptDocument.Script)get_store().find_element_user(SCRIPT$28, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "script" element
         */
        public int sizeOfScriptArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(SCRIPT$28);
            }
        }
        
        /**
         * Sets array of all "script" element
         */
        public void setScriptArray(x2.orgJpdl3.jbpm.ScriptDocument.Script[] scriptArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(scriptArray, SCRIPT$28);
            }
        }
        
        /**
         * Sets ith "script" element
         */
        public void setScriptArray(int i, x2.orgJpdl3.jbpm.ScriptDocument.Script script)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.ScriptDocument.Script target = null;
                target = (x2.orgJpdl3.jbpm.ScriptDocument.Script)get_store().find_element_user(SCRIPT$28, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(script);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "script" element
         */
        public x2.orgJpdl3.jbpm.ScriptDocument.Script insertNewScript(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.ScriptDocument.Script target = null;
                target = (x2.orgJpdl3.jbpm.ScriptDocument.Script)get_store().insert_element_user(SCRIPT$28, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "script" element
         */
        public x2.orgJpdl3.jbpm.ScriptDocument.Script addNewScript()
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.ScriptDocument.Script target = null;
                target = (x2.orgJpdl3.jbpm.ScriptDocument.Script)get_store().add_element_user(SCRIPT$28);
                return target;
            }
        }
        
        /**
         * Removes the ith "script" element
         */
        public void removeScript(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(SCRIPT$28, i);
            }
        }
        
        /**
         * Gets a List of "create-timer" elements
         */
        public java.util.List<x2.orgJpdl3.jbpm.CreateTimerDocument.CreateTimer> getCreateTimerList()
        {
            final class CreateTimerList extends java.util.AbstractList<x2.orgJpdl3.jbpm.CreateTimerDocument.CreateTimer>
            {
                public x2.orgJpdl3.jbpm.CreateTimerDocument.CreateTimer get(int i)
                    { return ProcessDefinitionImpl.this.getCreateTimerArray(i); }
                
                public x2.orgJpdl3.jbpm.CreateTimerDocument.CreateTimer set(int i, x2.orgJpdl3.jbpm.CreateTimerDocument.CreateTimer o)
                {
                    x2.orgJpdl3.jbpm.CreateTimerDocument.CreateTimer old = ProcessDefinitionImpl.this.getCreateTimerArray(i);
                    ProcessDefinitionImpl.this.setCreateTimerArray(i, o);
                    return old;
                }
                
                public void add(int i, x2.orgJpdl3.jbpm.CreateTimerDocument.CreateTimer o)
                    { ProcessDefinitionImpl.this.insertNewCreateTimer(i).set(o); }
                
                public x2.orgJpdl3.jbpm.CreateTimerDocument.CreateTimer remove(int i)
                {
                    x2.orgJpdl3.jbpm.CreateTimerDocument.CreateTimer old = ProcessDefinitionImpl.this.getCreateTimerArray(i);
                    ProcessDefinitionImpl.this.removeCreateTimer(i);
                    return old;
                }
                
                public int size()
                    { return ProcessDefinitionImpl.this.sizeOfCreateTimerArray(); }
                
            }
            
            synchronized (monitor())
            {
                check_orphaned();
                return new CreateTimerList();
            }
        }
        
        /**
         * Gets array of all "create-timer" elements
         * @deprecated
         */
        public x2.orgJpdl3.jbpm.CreateTimerDocument.CreateTimer[] getCreateTimerArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List<x2.orgJpdl3.jbpm.CreateTimerDocument.CreateTimer> targetList = new java.util.ArrayList<x2.orgJpdl3.jbpm.CreateTimerDocument.CreateTimer>();
                get_store().find_all_element_users(CREATETIMER$30, targetList);
                x2.orgJpdl3.jbpm.CreateTimerDocument.CreateTimer[] result = new x2.orgJpdl3.jbpm.CreateTimerDocument.CreateTimer[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "create-timer" element
         */
        public x2.orgJpdl3.jbpm.CreateTimerDocument.CreateTimer getCreateTimerArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.CreateTimerDocument.CreateTimer target = null;
                target = (x2.orgJpdl3.jbpm.CreateTimerDocument.CreateTimer)get_store().find_element_user(CREATETIMER$30, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "create-timer" element
         */
        public int sizeOfCreateTimerArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(CREATETIMER$30);
            }
        }
        
        /**
         * Sets array of all "create-timer" element
         */
        public void setCreateTimerArray(x2.orgJpdl3.jbpm.CreateTimerDocument.CreateTimer[] createTimerArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(createTimerArray, CREATETIMER$30);
            }
        }
        
        /**
         * Sets ith "create-timer" element
         */
        public void setCreateTimerArray(int i, x2.orgJpdl3.jbpm.CreateTimerDocument.CreateTimer createTimer)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.CreateTimerDocument.CreateTimer target = null;
                target = (x2.orgJpdl3.jbpm.CreateTimerDocument.CreateTimer)get_store().find_element_user(CREATETIMER$30, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(createTimer);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "create-timer" element
         */
        public x2.orgJpdl3.jbpm.CreateTimerDocument.CreateTimer insertNewCreateTimer(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.CreateTimerDocument.CreateTimer target = null;
                target = (x2.orgJpdl3.jbpm.CreateTimerDocument.CreateTimer)get_store().insert_element_user(CREATETIMER$30, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "create-timer" element
         */
        public x2.orgJpdl3.jbpm.CreateTimerDocument.CreateTimer addNewCreateTimer()
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.CreateTimerDocument.CreateTimer target = null;
                target = (x2.orgJpdl3.jbpm.CreateTimerDocument.CreateTimer)get_store().add_element_user(CREATETIMER$30);
                return target;
            }
        }
        
        /**
         * Removes the ith "create-timer" element
         */
        public void removeCreateTimer(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(CREATETIMER$30, i);
            }
        }
        
        /**
         * Gets a List of "cancel-timer" elements
         */
        public java.util.List<x2.orgJpdl3.jbpm.CancelTimerDocument.CancelTimer> getCancelTimerList()
        {
            final class CancelTimerList extends java.util.AbstractList<x2.orgJpdl3.jbpm.CancelTimerDocument.CancelTimer>
            {
                public x2.orgJpdl3.jbpm.CancelTimerDocument.CancelTimer get(int i)
                    { return ProcessDefinitionImpl.this.getCancelTimerArray(i); }
                
                public x2.orgJpdl3.jbpm.CancelTimerDocument.CancelTimer set(int i, x2.orgJpdl3.jbpm.CancelTimerDocument.CancelTimer o)
                {
                    x2.orgJpdl3.jbpm.CancelTimerDocument.CancelTimer old = ProcessDefinitionImpl.this.getCancelTimerArray(i);
                    ProcessDefinitionImpl.this.setCancelTimerArray(i, o);
                    return old;
                }
                
                public void add(int i, x2.orgJpdl3.jbpm.CancelTimerDocument.CancelTimer o)
                    { ProcessDefinitionImpl.this.insertNewCancelTimer(i).set(o); }
                
                public x2.orgJpdl3.jbpm.CancelTimerDocument.CancelTimer remove(int i)
                {
                    x2.orgJpdl3.jbpm.CancelTimerDocument.CancelTimer old = ProcessDefinitionImpl.this.getCancelTimerArray(i);
                    ProcessDefinitionImpl.this.removeCancelTimer(i);
                    return old;
                }
                
                public int size()
                    { return ProcessDefinitionImpl.this.sizeOfCancelTimerArray(); }
                
            }
            
            synchronized (monitor())
            {
                check_orphaned();
                return new CancelTimerList();
            }
        }
        
        /**
         * Gets array of all "cancel-timer" elements
         * @deprecated
         */
        public x2.orgJpdl3.jbpm.CancelTimerDocument.CancelTimer[] getCancelTimerArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List<x2.orgJpdl3.jbpm.CancelTimerDocument.CancelTimer> targetList = new java.util.ArrayList<x2.orgJpdl3.jbpm.CancelTimerDocument.CancelTimer>();
                get_store().find_all_element_users(CANCELTIMER$32, targetList);
                x2.orgJpdl3.jbpm.CancelTimerDocument.CancelTimer[] result = new x2.orgJpdl3.jbpm.CancelTimerDocument.CancelTimer[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "cancel-timer" element
         */
        public x2.orgJpdl3.jbpm.CancelTimerDocument.CancelTimer getCancelTimerArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.CancelTimerDocument.CancelTimer target = null;
                target = (x2.orgJpdl3.jbpm.CancelTimerDocument.CancelTimer)get_store().find_element_user(CANCELTIMER$32, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "cancel-timer" element
         */
        public int sizeOfCancelTimerArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(CANCELTIMER$32);
            }
        }
        
        /**
         * Sets array of all "cancel-timer" element
         */
        public void setCancelTimerArray(x2.orgJpdl3.jbpm.CancelTimerDocument.CancelTimer[] cancelTimerArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(cancelTimerArray, CANCELTIMER$32);
            }
        }
        
        /**
         * Sets ith "cancel-timer" element
         */
        public void setCancelTimerArray(int i, x2.orgJpdl3.jbpm.CancelTimerDocument.CancelTimer cancelTimer)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.CancelTimerDocument.CancelTimer target = null;
                target = (x2.orgJpdl3.jbpm.CancelTimerDocument.CancelTimer)get_store().find_element_user(CANCELTIMER$32, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(cancelTimer);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "cancel-timer" element
         */
        public x2.orgJpdl3.jbpm.CancelTimerDocument.CancelTimer insertNewCancelTimer(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.CancelTimerDocument.CancelTimer target = null;
                target = (x2.orgJpdl3.jbpm.CancelTimerDocument.CancelTimer)get_store().insert_element_user(CANCELTIMER$32, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "cancel-timer" element
         */
        public x2.orgJpdl3.jbpm.CancelTimerDocument.CancelTimer addNewCancelTimer()
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.CancelTimerDocument.CancelTimer target = null;
                target = (x2.orgJpdl3.jbpm.CancelTimerDocument.CancelTimer)get_store().add_element_user(CANCELTIMER$32);
                return target;
            }
        }
        
        /**
         * Removes the ith "cancel-timer" element
         */
        public void removeCancelTimer(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(CANCELTIMER$32, i);
            }
        }
        
        /**
         * Gets a List of "mail" elements
         */
        public java.util.List<x2.orgJpdl3.jbpm.MailDocument.Mail> getMailList()
        {
            final class MailList extends java.util.AbstractList<x2.orgJpdl3.jbpm.MailDocument.Mail>
            {
                public x2.orgJpdl3.jbpm.MailDocument.Mail get(int i)
                    { return ProcessDefinitionImpl.this.getMailArray(i); }
                
                public x2.orgJpdl3.jbpm.MailDocument.Mail set(int i, x2.orgJpdl3.jbpm.MailDocument.Mail o)
                {
                    x2.orgJpdl3.jbpm.MailDocument.Mail old = ProcessDefinitionImpl.this.getMailArray(i);
                    ProcessDefinitionImpl.this.setMailArray(i, o);
                    return old;
                }
                
                public void add(int i, x2.orgJpdl3.jbpm.MailDocument.Mail o)
                    { ProcessDefinitionImpl.this.insertNewMail(i).set(o); }
                
                public x2.orgJpdl3.jbpm.MailDocument.Mail remove(int i)
                {
                    x2.orgJpdl3.jbpm.MailDocument.Mail old = ProcessDefinitionImpl.this.getMailArray(i);
                    ProcessDefinitionImpl.this.removeMail(i);
                    return old;
                }
                
                public int size()
                    { return ProcessDefinitionImpl.this.sizeOfMailArray(); }
                
            }
            
            synchronized (monitor())
            {
                check_orphaned();
                return new MailList();
            }
        }
        
        /**
         * Gets array of all "mail" elements
         * @deprecated
         */
        public x2.orgJpdl3.jbpm.MailDocument.Mail[] getMailArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List<x2.orgJpdl3.jbpm.MailDocument.Mail> targetList = new java.util.ArrayList<x2.orgJpdl3.jbpm.MailDocument.Mail>();
                get_store().find_all_element_users(MAIL$34, targetList);
                x2.orgJpdl3.jbpm.MailDocument.Mail[] result = new x2.orgJpdl3.jbpm.MailDocument.Mail[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "mail" element
         */
        public x2.orgJpdl3.jbpm.MailDocument.Mail getMailArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.MailDocument.Mail target = null;
                target = (x2.orgJpdl3.jbpm.MailDocument.Mail)get_store().find_element_user(MAIL$34, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "mail" element
         */
        public int sizeOfMailArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(MAIL$34);
            }
        }
        
        /**
         * Sets array of all "mail" element
         */
        public void setMailArray(x2.orgJpdl3.jbpm.MailDocument.Mail[] mailArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(mailArray, MAIL$34);
            }
        }
        
        /**
         * Sets ith "mail" element
         */
        public void setMailArray(int i, x2.orgJpdl3.jbpm.MailDocument.Mail mail)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.MailDocument.Mail target = null;
                target = (x2.orgJpdl3.jbpm.MailDocument.Mail)get_store().find_element_user(MAIL$34, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(mail);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "mail" element
         */
        public x2.orgJpdl3.jbpm.MailDocument.Mail insertNewMail(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.MailDocument.Mail target = null;
                target = (x2.orgJpdl3.jbpm.MailDocument.Mail)get_store().insert_element_user(MAIL$34, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "mail" element
         */
        public x2.orgJpdl3.jbpm.MailDocument.Mail addNewMail()
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.MailDocument.Mail target = null;
                target = (x2.orgJpdl3.jbpm.MailDocument.Mail)get_store().add_element_user(MAIL$34);
                return target;
            }
        }
        
        /**
         * Removes the ith "mail" element
         */
        public void removeMail(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(MAIL$34, i);
            }
        }
        
        /**
         * Gets a List of "event" elements
         */
        public java.util.List<x2.orgJpdl3.jbpm.EventDocument.Event> getEventList()
        {
            final class EventList extends java.util.AbstractList<x2.orgJpdl3.jbpm.EventDocument.Event>
            {
                public x2.orgJpdl3.jbpm.EventDocument.Event get(int i)
                    { return ProcessDefinitionImpl.this.getEventArray(i); }
                
                public x2.orgJpdl3.jbpm.EventDocument.Event set(int i, x2.orgJpdl3.jbpm.EventDocument.Event o)
                {
                    x2.orgJpdl3.jbpm.EventDocument.Event old = ProcessDefinitionImpl.this.getEventArray(i);
                    ProcessDefinitionImpl.this.setEventArray(i, o);
                    return old;
                }
                
                public void add(int i, x2.orgJpdl3.jbpm.EventDocument.Event o)
                    { ProcessDefinitionImpl.this.insertNewEvent(i).set(o); }
                
                public x2.orgJpdl3.jbpm.EventDocument.Event remove(int i)
                {
                    x2.orgJpdl3.jbpm.EventDocument.Event old = ProcessDefinitionImpl.this.getEventArray(i);
                    ProcessDefinitionImpl.this.removeEvent(i);
                    return old;
                }
                
                public int size()
                    { return ProcessDefinitionImpl.this.sizeOfEventArray(); }
                
            }
            
            synchronized (monitor())
            {
                check_orphaned();
                return new EventList();
            }
        }
        
        /**
         * Gets array of all "event" elements
         * @deprecated
         */
        public x2.orgJpdl3.jbpm.EventDocument.Event[] getEventArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List<x2.orgJpdl3.jbpm.EventDocument.Event> targetList = new java.util.ArrayList<x2.orgJpdl3.jbpm.EventDocument.Event>();
                get_store().find_all_element_users(EVENT$36, targetList);
                x2.orgJpdl3.jbpm.EventDocument.Event[] result = new x2.orgJpdl3.jbpm.EventDocument.Event[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "event" element
         */
        public x2.orgJpdl3.jbpm.EventDocument.Event getEventArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.EventDocument.Event target = null;
                target = (x2.orgJpdl3.jbpm.EventDocument.Event)get_store().find_element_user(EVENT$36, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "event" element
         */
        public int sizeOfEventArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(EVENT$36);
            }
        }
        
        /**
         * Sets array of all "event" element
         */
        public void setEventArray(x2.orgJpdl3.jbpm.EventDocument.Event[] eventArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(eventArray, EVENT$36);
            }
        }
        
        /**
         * Sets ith "event" element
         */
        public void setEventArray(int i, x2.orgJpdl3.jbpm.EventDocument.Event event)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.EventDocument.Event target = null;
                target = (x2.orgJpdl3.jbpm.EventDocument.Event)get_store().find_element_user(EVENT$36, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(event);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "event" element
         */
        public x2.orgJpdl3.jbpm.EventDocument.Event insertNewEvent(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.EventDocument.Event target = null;
                target = (x2.orgJpdl3.jbpm.EventDocument.Event)get_store().insert_element_user(EVENT$36, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "event" element
         */
        public x2.orgJpdl3.jbpm.EventDocument.Event addNewEvent()
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.EventDocument.Event target = null;
                target = (x2.orgJpdl3.jbpm.EventDocument.Event)get_store().add_element_user(EVENT$36);
                return target;
            }
        }
        
        /**
         * Removes the ith "event" element
         */
        public void removeEvent(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(EVENT$36, i);
            }
        }
        
        /**
         * Gets a List of "exception-handler" elements
         */
        public java.util.List<x2.orgJpdl3.jbpm.ExceptionHandlerDocument.ExceptionHandler> getExceptionHandlerList()
        {
            final class ExceptionHandlerList extends java.util.AbstractList<x2.orgJpdl3.jbpm.ExceptionHandlerDocument.ExceptionHandler>
            {
                public x2.orgJpdl3.jbpm.ExceptionHandlerDocument.ExceptionHandler get(int i)
                    { return ProcessDefinitionImpl.this.getExceptionHandlerArray(i); }
                
                public x2.orgJpdl3.jbpm.ExceptionHandlerDocument.ExceptionHandler set(int i, x2.orgJpdl3.jbpm.ExceptionHandlerDocument.ExceptionHandler o)
                {
                    x2.orgJpdl3.jbpm.ExceptionHandlerDocument.ExceptionHandler old = ProcessDefinitionImpl.this.getExceptionHandlerArray(i);
                    ProcessDefinitionImpl.this.setExceptionHandlerArray(i, o);
                    return old;
                }
                
                public void add(int i, x2.orgJpdl3.jbpm.ExceptionHandlerDocument.ExceptionHandler o)
                    { ProcessDefinitionImpl.this.insertNewExceptionHandler(i).set(o); }
                
                public x2.orgJpdl3.jbpm.ExceptionHandlerDocument.ExceptionHandler remove(int i)
                {
                    x2.orgJpdl3.jbpm.ExceptionHandlerDocument.ExceptionHandler old = ProcessDefinitionImpl.this.getExceptionHandlerArray(i);
                    ProcessDefinitionImpl.this.removeExceptionHandler(i);
                    return old;
                }
                
                public int size()
                    { return ProcessDefinitionImpl.this.sizeOfExceptionHandlerArray(); }
                
            }
            
            synchronized (monitor())
            {
                check_orphaned();
                return new ExceptionHandlerList();
            }
        }
        
        /**
         * Gets array of all "exception-handler" elements
         * @deprecated
         */
        public x2.orgJpdl3.jbpm.ExceptionHandlerDocument.ExceptionHandler[] getExceptionHandlerArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List<x2.orgJpdl3.jbpm.ExceptionHandlerDocument.ExceptionHandler> targetList = new java.util.ArrayList<x2.orgJpdl3.jbpm.ExceptionHandlerDocument.ExceptionHandler>();
                get_store().find_all_element_users(EXCEPTIONHANDLER$38, targetList);
                x2.orgJpdl3.jbpm.ExceptionHandlerDocument.ExceptionHandler[] result = new x2.orgJpdl3.jbpm.ExceptionHandlerDocument.ExceptionHandler[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "exception-handler" element
         */
        public x2.orgJpdl3.jbpm.ExceptionHandlerDocument.ExceptionHandler getExceptionHandlerArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.ExceptionHandlerDocument.ExceptionHandler target = null;
                target = (x2.orgJpdl3.jbpm.ExceptionHandlerDocument.ExceptionHandler)get_store().find_element_user(EXCEPTIONHANDLER$38, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "exception-handler" element
         */
        public int sizeOfExceptionHandlerArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(EXCEPTIONHANDLER$38);
            }
        }
        
        /**
         * Sets array of all "exception-handler" element
         */
        public void setExceptionHandlerArray(x2.orgJpdl3.jbpm.ExceptionHandlerDocument.ExceptionHandler[] exceptionHandlerArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(exceptionHandlerArray, EXCEPTIONHANDLER$38);
            }
        }
        
        /**
         * Sets ith "exception-handler" element
         */
        public void setExceptionHandlerArray(int i, x2.orgJpdl3.jbpm.ExceptionHandlerDocument.ExceptionHandler exceptionHandler)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.ExceptionHandlerDocument.ExceptionHandler target = null;
                target = (x2.orgJpdl3.jbpm.ExceptionHandlerDocument.ExceptionHandler)get_store().find_element_user(EXCEPTIONHANDLER$38, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(exceptionHandler);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "exception-handler" element
         */
        public x2.orgJpdl3.jbpm.ExceptionHandlerDocument.ExceptionHandler insertNewExceptionHandler(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.ExceptionHandlerDocument.ExceptionHandler target = null;
                target = (x2.orgJpdl3.jbpm.ExceptionHandlerDocument.ExceptionHandler)get_store().insert_element_user(EXCEPTIONHANDLER$38, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "exception-handler" element
         */
        public x2.orgJpdl3.jbpm.ExceptionHandlerDocument.ExceptionHandler addNewExceptionHandler()
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.ExceptionHandlerDocument.ExceptionHandler target = null;
                target = (x2.orgJpdl3.jbpm.ExceptionHandlerDocument.ExceptionHandler)get_store().add_element_user(EXCEPTIONHANDLER$38);
                return target;
            }
        }
        
        /**
         * Removes the ith "exception-handler" element
         */
        public void removeExceptionHandler(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(EXCEPTIONHANDLER$38, i);
            }
        }
        
        /**
         * Gets a List of "task" elements
         */
        public java.util.List<x2.orgJpdl3.jbpm.TaskDocument.Task> getTaskList()
        {
            final class TaskList extends java.util.AbstractList<x2.orgJpdl3.jbpm.TaskDocument.Task>
            {
                public x2.orgJpdl3.jbpm.TaskDocument.Task get(int i)
                    { return ProcessDefinitionImpl.this.getTaskArray(i); }
                
                public x2.orgJpdl3.jbpm.TaskDocument.Task set(int i, x2.orgJpdl3.jbpm.TaskDocument.Task o)
                {
                    x2.orgJpdl3.jbpm.TaskDocument.Task old = ProcessDefinitionImpl.this.getTaskArray(i);
                    ProcessDefinitionImpl.this.setTaskArray(i, o);
                    return old;
                }
                
                public void add(int i, x2.orgJpdl3.jbpm.TaskDocument.Task o)
                    { ProcessDefinitionImpl.this.insertNewTask(i).set(o); }
                
                public x2.orgJpdl3.jbpm.TaskDocument.Task remove(int i)
                {
                    x2.orgJpdl3.jbpm.TaskDocument.Task old = ProcessDefinitionImpl.this.getTaskArray(i);
                    ProcessDefinitionImpl.this.removeTask(i);
                    return old;
                }
                
                public int size()
                    { return ProcessDefinitionImpl.this.sizeOfTaskArray(); }
                
            }
            
            synchronized (monitor())
            {
                check_orphaned();
                return new TaskList();
            }
        }
        
        /**
         * Gets array of all "task" elements
         * @deprecated
         */
        public x2.orgJpdl3.jbpm.TaskDocument.Task[] getTaskArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List<x2.orgJpdl3.jbpm.TaskDocument.Task> targetList = new java.util.ArrayList<x2.orgJpdl3.jbpm.TaskDocument.Task>();
                get_store().find_all_element_users(TASK$40, targetList);
                x2.orgJpdl3.jbpm.TaskDocument.Task[] result = new x2.orgJpdl3.jbpm.TaskDocument.Task[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "task" element
         */
        public x2.orgJpdl3.jbpm.TaskDocument.Task getTaskArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.TaskDocument.Task target = null;
                target = (x2.orgJpdl3.jbpm.TaskDocument.Task)get_store().find_element_user(TASK$40, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "task" element
         */
        public int sizeOfTaskArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(TASK$40);
            }
        }
        
        /**
         * Sets array of all "task" element
         */
        public void setTaskArray(x2.orgJpdl3.jbpm.TaskDocument.Task[] taskArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(taskArray, TASK$40);
            }
        }
        
        /**
         * Sets ith "task" element
         */
        public void setTaskArray(int i, x2.orgJpdl3.jbpm.TaskDocument.Task task)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.TaskDocument.Task target = null;
                target = (x2.orgJpdl3.jbpm.TaskDocument.Task)get_store().find_element_user(TASK$40, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(task);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "task" element
         */
        public x2.orgJpdl3.jbpm.TaskDocument.Task insertNewTask(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.TaskDocument.Task target = null;
                target = (x2.orgJpdl3.jbpm.TaskDocument.Task)get_store().insert_element_user(TASK$40, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "task" element
         */
        public x2.orgJpdl3.jbpm.TaskDocument.Task addNewTask()
        {
            synchronized (monitor())
            {
                check_orphaned();
                x2.orgJpdl3.jbpm.TaskDocument.Task target = null;
                target = (x2.orgJpdl3.jbpm.TaskDocument.Task)get_store().add_element_user(TASK$40);
                return target;
            }
        }
        
        /**
         * Removes the ith "task" element
         */
        public void removeTask(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(TASK$40, i);
            }
        }
        
        /**
         * Gets the "name" attribute
         */
        public java.lang.String getName()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(NAME$42);
                if (target == null)
                {
                    return null;
                }
                return target.getStringValue();
            }
        }
        
        /**
         * Gets (as xml) the "name" attribute
         */
        public org.apache.xmlbeans.XmlString xgetName()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlString target = null;
                target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(NAME$42);
                return target;
            }
        }
        
        /**
         * Sets the "name" attribute
         */
        public void setName(java.lang.String name)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(NAME$42);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(NAME$42);
                }
                target.setStringValue(name);
            }
        }
        
        /**
         * Sets (as xml) the "name" attribute
         */
        public void xsetName(org.apache.xmlbeans.XmlString name)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlString target = null;
                target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(NAME$42);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(NAME$42);
                }
                target.set(name);
            }
        }
    }
}
